<h2 class="group"><%= @group.name %></h2>

<div class="button_bar">
<% if session['user'] %>
  <% if not session['user'].groups.include?(@group) %>
    <%= link_to(I18n.t(:join_group), {:controller=>'group',:action=>'join', :id=>@group.id}, {:class=>:button}) %>
  <% else %>
    <%= link_to(I18n.t(:create_game), {:controller=>'game',:action=>'create_form', :id=>@group.id}, {:class=>:button}) %>
    <%= link_to(I18n.t(:edit), {:controller=>'group',:action=>'edit_form', :id=>@group.id}, {:class=>:button}) %>
  <% end %>
<% end %>
</div>


<% if @group.descr != '' %>
<div class="game_descr">
<%= simple_format @group.descr %>
</div>
<% end %>


<h3><%= I18n.t(:rankings) %> (todo)</h3>
<ol>
<% for user in @group.rankings(:cash) %>
  <li><b><%= user.name %></b> <%= user.chips(@group.id) %></li>
<% end %>
</ol>

<h3><%= I18n.t(:last_games) %> (<%= @group.games.size %> <%= I18n.t(:nb_games) %>)</h3>

<ol>
<%= render(:partial=>'game', :collection=>@games) %>
</ol>
